{literal}
<script type="text/javascript">
    $(document).ready(function() {
        $("input#autocomplete").autocomplete({
            {/literal}
            source: [{$autocomplete_data|default:''}]
                {literal}
            });
        });
</script>
{/literal}
<div class="head-content">
    <h3>Batch Upload Converter</h3>
    <div class="clear"></div>
</div>
<div class="sub-nav-content">
    <ul>
        <li><a href="{$config->site_url('converter/batchupload')}" class="active">1. Upload File</a></li>
    </ul>
    <div class="clear"></div>
</div>
{if !empty($detail)}
<div class="table-info-box">
    <h3>Default Format</h3>
    <table class="table-info" width="100%">
        <tr>
            <td width="25%">Versi Format Input<br /><em>Input Versions</em> </td>
            <td width="25%">{$detail.input_version|default:''}</td>
            <td width="25%">Versi Format Output<br /><em>Output Versions</em> </td>
            <td width="25%">{$detail.output_version|default:''}</td>
        </tr>
        <tr>
            <td>Jenis Format <br /><em>Format Type</em> </td>
            <td>{$detail.input_format_type|default:''}</td>
            <td>Jenis File <br /><em>File Type</em> </td>
            <td>{$detail.input_file_type|default:''}</td>
        </tr>
        <tr>
            <td>Baris Mulai <br /><em>Start Row</em> </td>
            <td>{$detail.input_row|default:''}</td>
            <td>Pemisah <br /><em>Delimiter</em> </td>
            <td>{$detail.input_delimiter|default:''}</td>
        </tr>
        <tr>
            <td>Dekripsi File dengan GPG<br /><em>GPG Decryption</em> </td>
            <td><b>{$gpg_decrypt|upper}</b></td>
            <td>Pilih format lainnya?<br /><em>Choose Another Format?</em> </td>
            <td>
                <a href="{$config->site_url('converter/batchupload/process_default_clear')}" class="button-edit">Set Default Format</a>
            </td>
        </tr>
    </table>
</div>
<div class="clear"></div>
<!-- notification template -->
{include file="base/templates/notification.html"}
<!-- end of notification template-->
<form action="{$config->site_url('converter/batchupload/process_upload')}" method="post" enctype="multipart/form-data">
    <input type="hidden" name="status" value="true" />
    <table class="table-input" width="100%">
        <tr class="headrow">
            <th colspan="2">Upload Form</th>
        </tr>
        <tr>
            <td>Debitted Account <br /><em>Debitted Account</em> </td>
            <td><input type="text" name="debitted_account" value="{$debitted_account|default:''}" size="25" maxlength="100" id="autocomplete" /></td>
        </tr>
        <tr>
            <td width="25%">Cari Berkas <br /><em>Upload File</em> </td>
            <td width="75%"><input type="file" name="file_upload" size="30" /> * <em>required</em></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" name="save" value="Upload" /> </td>
        </tr>
    </table>
</form>
{else}
<div class="table-info-box">
    <h3>Default Format</h3>
    <table class="table-info" width="100%">
        <tr>
            <td><b>Info</b> : <b style="color: #E61120;">default format belum di atur!</b></td>
        </tr>
    </table>
</div>
<div class="clear"></div>
<!-- notification template -->
{include file="base/templates/notification.html"}
<!-- end of notification template-->
<form action="{$config->site_url('converter/batchupload/process_default')}" method="post">
    <table class="table-view" width="100%">
        <tr>
            <th width="5%"></th>
            <th width="5%">No</th>
            <th width="20%">Format Type</th>
            <th width="25%">Input Versions</th>
            <th width="10%">File Type</th>
            <th width="10%">Delimiter</th>
            <th width="25%">Output Versions</th>
        </tr>
        {foreach from=$rs_id key=no item=data}
        <tr {if ($data.default_status eq 'yes') <> 0}style="background-color: #EAFEED;"{/if}>
            <td align="center"><input type="radio" name="default" id="default{$no}" value="{$data.input_id}" /> </td>
            <td>{$no + 1}.</td>
            <td><label for="default{$no}">{$data.input_format_type}</label></td>
            <td><label for="default{$no}">{$data.input_version}</label></td>
            <td align="center"><label for="default{$no}">{$data.input_file_type}</label></td>
            <td align="center"><label for="default{$no}">{$data.input_delimiter}</label></td>
            <td><label for="default{$no}">{$data.output_version}</label></td>
        </tr>
        {foreachelse}
        <tr>
            <td colspan="7">Data not found</td>
        </tr>
        {/foreach}
        <tr>
            <td colspan="7"><input type="submit" value="Update" /> </td>
        </tr>
    </table>
</form>
{/if}